import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
import './App.scss'
import Layout from '@/pages/Layout'
import Login from '@/pages/Login'
import Home from './pages/Home'
import Profile from './pages/Profile'
import ProfileEdit from './pages/Profile/Edit'
import Search from './pages/Search'
import Result from './pages/Search/Result'
import Chat from './pages/Chat'
import Article from './pages/Article'
import { Auth } from '@/components/Auth'
import { HistoryRouter, history } from '@/utils/history'
function App() {
  return (
    <HistoryRouter history={history}>
      <div className="App">
        <Routes>
          <Route path="/" element={<Layout />}>
            <Route index element={<Home />}></Route>
            <Route
              path="/profile"
              element={
                <Auth>
                  <Profile />
                </Auth>
              }></Route>
          </Route>
          <Route path="/login" element={<Login />} />
          <Route path="/profile/edit" element={<ProfileEdit />}></Route>
          <Route path="/chat" element={<Chat />}></Route>
          <Route path="/search" element={<Search />}></Route>
          <Route path="/searchResult" element={<Result />}></Route>
          <Route path="/article" element={<Article />}></Route>
        </Routes>
      </div>
    </HistoryRouter>
  )
}

export default App
